function f = new_eq_tt2(tax,mc_cf,theta2,ind_market,x2, delta, QI,FC,total_market2,...
    ss,v,cat2,UVT,tariffs,sales_tax,tier,kk,year)

FC_i=FC(:,ss);
cat_t=cat2.*tax* UVT;

m0=mc_cf.*(1+tariffs); 
p0=(m0./1000.*(1+sales_tax+tier))+(cat_t./1000);
expmu3=expmu(theta2,v,x2,p0);
sj_0=mktshares(delta,expmu3,QI,ind_market);
sim_un=round(sj_0.*total_market2(ind_market,2),0);
st_0=sim_un.*((m0./1000.*(sales_tax+tier))+(cat_t./1000));
tt_0=sim_un.*(mc_cf./1000.*(tariffs));
total_0=tt_0+st_0;
tmp=find(year==kk);
f=abs(sum(FC_i(tmp,:))*1000-sum(total_0(tmp,:))*1000);
end